﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="SurveyTokenData" targetNamespace="http://tempuri.org/SurveyTokenData.xsd" xmlns:mstns="http://tempuri.org/SurveyTokenData.xsd" xmlns="http://tempuri.org/SurveyTokenData.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="SurveyDevConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="SurveyDevConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.Votations.NSurvey.BE.Properties.Settings.GlobalReference.Default.SurveyDevConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="SurveyTokenTableAdapter" GeneratorDataComponentClassName="SurveyTokenTableAdapter" Name="SurveyToken" UserDataComponentName="SurveyTokenTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SurveyDevConnectionString (Settings)" DbObjectName="SurveyDev.dbo.vts_tbSurveyToken" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[vts_tbSurveyToken] WHERE (([TokenId] = @Original_TokenId) AND ([SurveyId] = @Original_SurveyId) AND ([Token] = @Original_Token) AND ([CreationDate] = @Original_CreationDate) AND ([Used] = @Original_Used))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TokenId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TokenId" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_SurveyId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SurveyId" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Token" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Token" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_CreationDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="CreationDate" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_Used" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="Used" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[vts_tbSurveyToken] ([SurveyId], [Token], [CreationDate], [Used]) VALUES (@SurveyId, @Token, @CreationDate, @Used);
SELECT TokenId, SurveyId, Token, CreationDate, Used FROM vts_tbSurveyToken WHERE (TokenId = SCOPE_IDENTITY())</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@SurveyId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SurveyId" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Token" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Token" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@CreationDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="CreationDate" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Used" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="Used" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>SELECT TokenId, SurveyId, Token, CreationDate, Used FROM dbo.vts_tbSurveyToken</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[vts_tbSurveyToken] SET [SurveyId] = @SurveyId, [Token] = @Token, [CreationDate] = @CreationDate, [Used] = @Used WHERE (([TokenId] = @Original_TokenId) AND ([SurveyId] = @Original_SurveyId) AND ([Token] = @Original_Token) AND ([CreationDate] = @Original_CreationDate) AND ([Used] = @Original_Used));
SELECT TokenId, SurveyId, Token, CreationDate, Used FROM vts_tbSurveyToken WHERE (TokenId = @TokenId)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@SurveyId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SurveyId" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Token" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Token" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@CreationDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="CreationDate" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Used" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="Used" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TokenId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TokenId" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_SurveyId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SurveyId" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Token" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Token" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_CreationDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="CreationDate" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_Used" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="Used" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="TokenId" ColumnName="TokenId" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@TokenId" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TokenId" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="TokenId" DataSetColumn="TokenId" />
              <Mapping SourceColumn="SurveyId" DataSetColumn="SurveyId" />
              <Mapping SourceColumn="Token" DataSetColumn="Token" />
              <Mapping SourceColumn="CreationDate" DataSetColumn="CreationDate" />
              <Mapping SourceColumn="Used" DataSetColumn="Used" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="SurveyTokenData" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="SurveyTokenData" msprop:Generator_UserDSName="SurveyTokenData">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="SurveyToken" msprop:Generator_TableClassName="SurveyTokenDataTable" msprop:Generator_TableVarName="tableSurveyToken" msprop:Generator_TablePropName="SurveyToken" msprop:Generator_RowDeletingName="SurveyTokenRowDeleting" msprop:Generator_UserTableName="SurveyToken" msprop:Generator_RowChangingName="SurveyTokenRowChanging" msprop:Generator_RowEvHandlerName="SurveyTokenRowChangeEventHandler" msprop:Generator_RowDeletedName="SurveyTokenRowDeleted" msprop:Generator_RowEvArgName="SurveyTokenRowChangeEvent" msprop:Generator_RowChangedName="SurveyTokenRowChanged" msprop:Generator_RowClassName="SurveyTokenRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="TokenId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnTokenId" msprop:Generator_ColumnPropNameInRow="TokenId" msprop:Generator_ColumnPropNameInTable="TokenIdColumn" msprop:Generator_UserColumnName="TokenId" type="xs:int" />
              <xs:element name="SurveyId" msprop:Generator_ColumnVarNameInTable="columnSurveyId" msprop:Generator_ColumnPropNameInRow="SurveyId" msprop:Generator_ColumnPropNameInTable="SurveyIdColumn" msprop:Generator_UserColumnName="SurveyId" type="xs:int" />
              <xs:element name="Token" msprop:Generator_ColumnVarNameInTable="columnToken" msprop:Generator_ColumnPropNameInRow="Token" msprop:Generator_ColumnPropNameInTable="TokenColumn" msprop:Generator_UserColumnName="Token">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="40" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CreationDate" msprop:Generator_ColumnVarNameInTable="columnCreationDate" msprop:Generator_ColumnPropNameInRow="CreationDate" msprop:Generator_ColumnPropNameInTable="CreationDateColumn" msprop:Generator_UserColumnName="CreationDate" type="xs:dateTime" />
              <xs:element name="Used" msprop:Generator_ColumnVarNameInTable="columnUsed" msprop:Generator_ColumnPropNameInRow="Used" msprop:Generator_ColumnPropNameInTable="UsedColumn" msprop:Generator_UserColumnName="Used" type="xs:boolean" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:SurveyToken" />
      <xs:field xpath="mstns:TokenId" />
    </xs:unique>
  </xs:element>
</xs:schema>